﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Resources;
using System.Reflection;

namespace RevClinic.Core.Resources
{
    public static class ResourceHelper
    {
        private static string ResourceMsgKey(Type type, object value)
        {
            return String.Format("{0}_{1}", type.Name, value.ToString());
        }

        public static string ToLocalizedString(this Enum enumeration)
        {
            string resourceKey = ResourceMsgKey(enumeration.GetType(), enumeration.ToString());
            return TypeMsg.ResourceManager.GetString(resourceKey);
        }

    }
}
